package com.edu.neusoft.elec_shop.domain;

import lombok.Data;

import javax.validation.constraints.*;

@Data
public class User {
    @NotNull(message = "用户ID不能为空")
    private Long userId;

    @NotBlank(message = "用户名不能为空")
    @Size(min = 2, max = 30, message = "用户名长度必须在2到30个字符之间")
    private String userName;

    @NotBlank(message = "密码不能为空")
    @Size(min = 6, message = "密码长度必须至少为6个字符")
    private String password;

    @Email(message = "电子邮件格式不正确")
    private String email;

    @NotBlank(message = "电话号码不能为空")
    @Pattern(regexp = "^\\d{3}-\\d{3}-\\d{4}$", message = "电话号码格式不正确（例如：123-456-7890）")
    private String phone;

    @NotBlank(message = "地址不能为空")
    private String address;
}